//
//  PersonHeaderTableViewCell.m
//  PropertyManager
//
//  Created by TNG on 2018/7/12.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "PersonHeaderTableViewCell.h"

@implementation PersonHeaderTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
        self.backgroundColor = SFMNavBarColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

-(void)creatUI{
    [self.contentView addSubview:self.img];
    [self.contentView addSubview:self.nameLabel];
}

-(UIImageView *)img
{
    if (_img == nil) {
        _img = [[UIImageView alloc] initWithFrame:CGRectMake(15, 40, 62, 62)];
        _img.contentMode = UIViewContentModeScaleAspectFill;
        _img.layer.cornerRadius = 31;
        _img.clipsToBounds = YES;
    }
    return _img;
}

-(UILabel *)nameLabel
{
    if (_nameLabel == nil) {
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 40, WIDTH - 115, 62)];
        _nameLabel.font = font(30);
        _nameLabel.textColor = SFMColor(255, 255, 255);
        _nameLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _nameLabel;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
